#include "dyn_ode_rk2.h"

RK2::RK2(MultiFunctor &func,
         colvec _initCond,
         double _start,
         double _end,
         double _initStepsize)
    : ODE(func,_initCond,_start,_end,_initStepsize)
{
}

colvec RK2::next(colvec previousStep)
{
    colvec k1 = initStepsize*integrand(previousStep);
    colvec k2 = initStepsize*integrand(previousStep+0.5*k1);

    return previousStep+k2;
}
